Copyright: Visual Help Copyright® 1993 Firas Bushnaq


CONTENTS
Asgard InterFace

Asgard interface is a library for Visual Basic programmers which is written entirely in VB with a number of Windows API calls. This is NOT 'examples' on how to achieve something, but properly defined libraries with procedures which you call from your code just like your own procedures.

This means:
- No VBX to distribute and update.
- Easily portable to other versions of VB (for NT for instance).
- Portable between your different projects.
- You can easily change the behaviour/looks by changing the Visual Basic code.
- Works under Visual Basic version 2 and 3

And although Asgard Interface is using a lot of graphics most of these routines do not require a lot of resources. For instance the Tabs, 3D borders and Zoom requires NO controls at all, the Toolbox, Status bar and Balloon help only requires one picture box and Guide only uses one form + 5 command buttons.

Main Features

 Guide

 Toolbox

 Tabs

 Status bar

 Balloon help

 Zoom and 3D borders

How to order

How it works

Background


GUIDE
Asgard Interface - Guide

What is Guide?

Guide is a online step-by-step based tutorial, somewhat similar to the usual Windows Help but with one important difference: It can actually DEMONSTRATE the task in hand for the user.

What this means is that if you want to explain to your users how to open a file, you would first tell them what they are going to do (in the Guide window), then if they click on the Show button Guide would actually open a file for them (Or just show them which menu to select if you feel this is a better approach). Similarily, if you want to tell them where they need to fill in the last name in a database for instance, Guide would automatically move the mouse to the last name field, activate it and (optionally) highlight it and enter a name there.

How to use Guide

To use the Guide facility you write a 'script' with the script editor which is included with Asgard Interface. Here you define headlines, sub headlines, explanatory text, which controls to highlight/activate and what topics to jump to (if needed).

Then all you need to do is to specify the filename of the script and from within you application load the Guide form (frmGuide.Show). The Guide will then run the script automatically without any programmer interaction.

Example:

Select GUIDE from the Help menu in the demo application.


TOOLBOX
Asgard Interface - Toolbox/Toolbar

What is Toolbox

The Toolbox part of Asgard Interface provides you with a control which allows you to have several picture buttons grouped together in a box. This can take 3 forms: VB toolbox emulation (floating tools non resizeable), AmiPro (floating tools w/resizeable border) or Excel type (fixed toolbar under the menu).

Features:

 - Multistate buttons
Asgard ToolBox supports 3 states for the buttons in the toolbox: UP, DOWN and DISABLED.
 - Group of buttons
You can have a group of buttons, i.e. only one of the buttons can be down at a time. this is similar to the Visual Basic option buttons.
 - Buttons which stay down or not
You can define whether a button should stay down once it is pressed, or if it should come out like the standard Visual Basic command buttons.
 - Multiple toolsets
The toolbox supports multiple 'toolsets', i.e. you can change the type of tools which is displayed (with ONE single call to a sub routine) depending on the task at hand.
 - Button properties changeable from within your code
As well as automatically handling the users clicking on a buttons, and changing it's appearance, you can change these from within your code: Disable, enable or set the UP/DOWN position of a button. Useful to give visual feedback to the user.
 - Repeated clicks when keep mousebutton down
Asgard Toolbox also supports a 'repeater' effect: When a mouse button is pressed down, it repeats the calls to your code until it is let up again. This is similar to the Spin button in VB.
 - Drag and drop support
As well as allowing you to click a button, you can also drag and drop controls onto the buttons.
 - Switch between toolbar fixed under menu & floating tool palette
The toolbox can be switched between a floating toolpalette and a fixed toolbar (similar to Lotus programmes). This gives you flexibility to change it depending on your type of application (or user preference).
 - Freezing a button
You can temporarily 'freeze' a button. this means that the user can not click the button, and no call will be generated to your code.
 - Support for user info
This means that you can inform your users what a particular button is used for when the right mouse button is pressed, using either balloon help or status bar.
 - Move mouse away support
The toolbox provides proper 'move away' support, i.e. if the user clicks a button, but then moves the mouse pointer away, the button will immediately come out again, just like the standard windows buttons.

How to use Toolbox

To use a toolbox in your application you need to: Design a BMP file which contains all the buttons you want to use in the toolbox, initialize the toolbox with a single line of code and supply code to react to the various buttons being clicked. Thats all! You can then add code as needed if you want to manipulate the buttons individually from inside your programme or if you want to change the toolset. If not everything will be handled automatically.

Example:

Click on the various buttons in the toolbox with the LEFT mousebutton. Also select the Tool Settings menu.


TABS
Asgard Interface - Tabs

What is Tabs

Tabs allows you to create a set of buttons which looks like a set of pages with tabs on them, similar to a filofax for instance. This way you can present the user with a number of related options they can choose between without having to open several dialogue boxes. An example of this is seen in the latest version of Excel.

You can have Tabs both on top or bottom of a tab set, use any font in any size or color, adding and deleting tab sets at runtime, Enable/Disable tabs at runtime and query the settings at runtime (i.e. which tab is the active one)

How to use Tabs

To use it you just call the Initialize_Tab with parameters describing the look of the tabs, size, position, captions and number of tabs. Then you need to add a call in the Mouse and Paint events of your form to handle the drawing of the tabs and check if they are clicked. If a tab is clicked the Tab_Clicked routine is called automatically and you place code there to react to the tabs being pressed.

Example:

See the Asgard Tabs form.


STATUS BAR
Asgard Interface - Status Bar

What is Status Bar

The Status Bar in Asgard Interface allows you to create a statusbar similar to what you find in Excel, Ami Pro etc, with a few additional features. These are the options you have:

•	Message
You can display any message in any of the sections in the status bar.

•	Important messages
You can display any message which will cover ALL of the status bar, for instance to tell the user that you are reindexing a database or deleting a file.

•	Buttons
A Status Bar section can act as a button, that is it will be pressed down if the user clicks on it and a subroutine called StatBar_Click will be called.

•	Gauge
A field which has text in it can also be used as a Gauge, that is a meter displaying work in progress.

•	Picture
As well as displaying text you can also display pictures in the Status Bar. This is especially useful if you want it to act as a button.

•	Sections
The status bar can be divided into any number of sections, each of which can be a button or not, use a picture or text, act as a gauge or not or they can all be replaced with an important message.

How to use Status Bar

To use this you first tell Asgard Interface which picture control to use as a status bar. (One line of code). Then for each section you want in your status bar you need to call StatBar_Add with the size and type info. Finally you need to call the routine which updates the status bar from the _Paint event of the control.

Example:

See the status bar at the bottom of the main window, and use the coices under the Statusbar Settings menu to change the look of it. You can also click on the first section in the statusbar to start the online help.


BALLOON HELP
Asgard Interface - Balloon help

What is Balloon Help?

If you have ever use a Macintosh computer running system 7 you may be familiar with something called Balloon Help. This is simply small balloons which contains information or tips on how to use a particular control. For instance if you have a Cancel button in a dialogue box you could use this to tell the user that if they clicked on that button the dialogue box would close down without saving the information.

How to use Balloon Help

To use this facility you first initialize it on startup by telling it what type of font to use in the balloons, and where to store the background which the balloon is displayed over (this is then restored when the balloon is turned off). Then simply call a sub routine called Balloon_Show with the text to display whenever you want to display a balloon.

Example

Click on the statusbar, any of the buttons in the toolbox or on any of the tabs with the RIGHT mouse button.


ZOOM
Asgard Interface - Zoom / 3D borders

With one single line of code you can add the Macintosh 'ZOOM' effect to your forms as they open and close.

EXAMPLE: Zoom Test menu

If you want your windows to have a 3D border you can achieve this with one call in your forms paint and resize event. Even RESIZEABLE forms can be 3D!

EXAMPLE: The Guide window is using the 3D effect, as is the Zoom Test window. Se above.


HOW TO ORDER
HOW TO ORDER ASGARD INTERFACE SOURCE CODE:

•	To order via CompuServe:

GO SWREG at any ! prompt. This will take you to the ShareWare registration database. Follow the onscreen instructions on screen. The Registration ID for Asgard Interface is 2623. The cost is 30 US dollar.

•	To order via Mail: (Cheques and Money orders only)

Select print from the file menu to print out this order form and fill in the required fields.

---
Please send me Asgard Interface for Visual Basic:
Name:	_______________________________________
Address:	_______________________________________
_______________________________________
_______________________________________
Country:	_______________________________________
Tel:	_______________________________________
EMail:	_______________________________________

Where did you find Asgard Interface:_______________________
Send by: Mail__ E-Mail__
Cheque/money order for 30 US$ enclosed. If you live outside the UK add 2 US$ for postage and packaging!
---

What you receive:
When you purchase Asgard Interface you will receive the full source code which is well documented as well as a Windows helpfile documenting all the functions you need to call, or which will be called from Interface. You also receive the source code of this application. This will be emailed to you if you order via CompuServe or mailed if you specify so on the mail order form above. We will also provide help to any problems/questions you have with the code via E-Mail (CIS or CIX).

Asgard Software
PO Box 624
Oxford
OX4 3NY
UK
Tel: 	+44 (0)865 209084
Fax: 	+44 (0)865 771461
EMAIL: 	CIS: 100113,431
aberji@cix.compulink.co.uk


HOW IT WORKS
How does Asgard Interface work?

The code which constitutes Asgard Interface is contained in 6 .BAS files, one for each of the functions (Tabs, Zoom etc) which is provided. You simply add these .BAS files to your project and thereby adding all the functionality they contain. Then you follow these steps:

1	Add code in the Form_Load event to initialize the elements you are using (Tabs, Statusbar etc) if needed. This usually tells Asgard Interface what type fonts you want to use, color etc. NB: Some routines does not need to be initialized.

2	Add a line of code in the Mouse and/or Paint events of form/control. This will then take care of any display work needed as well as calling any SUBS if it is a 'button' routine (Tabs, Toolbox and Status bar)

3	For Guides you need to write a script with the special script editor which is included and just load the Guide form. Everything else is done automatically. For the 3D borders you need just a line in the paint event and nothing else and for Zoom effect you only need a line in the form load and unload events. For the balloon help you need to call Balloon_Show everytime you want to display a balloon, for instance when they click with the right mouse button on a menu.

4	If you use one of the 'button' routines (Tabs, Toolbox and Status bar) you also need to add code which responds to the button which has been clicked, this is similar to adding code in a command buttons _Click event.

5	Thats all!


BACKGROUND
Like most software developers I wanted to have an attractive interface in my applications, using the latest 'toolbar' look, and later the tabbed dialogue boxes seen in various Microsoft applications. However I was not to keen on having yet another VBX to distribute and update, so I tried to figure out a way to do it in Visual Basic code, with a little help from the Windows API. It proved perfectly possible, and showed that VB is capable of anything you can do in C or any other language. (The VBX capability seem to have made us all a little lazy <g>).

The resulting code has now been used in several of my applications, and I am now releasing the source code for sale. This demo applications shows all the capabilities of the Asgard Interface routines. If you would like to order the source code, go to How to Order and select print from the file menu.

Arild Bergh
Oxford, 11 May 94